function setType(id, mime) {
	var type = ""
	var errMsg = "This browser is not equipped for scripted sound.\n\n"
	var OS = getOS()
	var brand = getBrand()
	var ver = getVersion(brand)
	if (brand == "IE") {
		if (ver > 4) {
			if (OS == "Win") {
				if (document.all(id) && document.all(id).CreationDate != "") {
					return "isMP"
				} else {
					errMsg += "Expecting Windows Media Player Version 6.4."
				}
			} else {
				errMsg += "Only Internet Explorer for Windows is supported."
			}
		} else { 
			errMsg += "Only Internet Explorer 4 or later for Windows is supported."
		}
	} else if (brand == "NN") {
		if ((ver >= 3 && ver < 4.6) || (ver >= 4.7 && ver < 6)) {
			if (mimeAndPluginReady(mime, "LiveAudio")) {
				return "isLA"
			}
			if (mimeAndPluginReady(mime, "QuickTime")) {
				qtVer = parseFloat(document.embeds[id].GetPluginVersion(), 10)
				if (qtVer >= 4.1) {
					return "isQT"
				} else {
					errMsg += "QuickTime Plugin 4.1 or later is required."
				}
			} else {
				errMsg += "Sound control requires QuickTime Plugin 4.1 (or later) or LiveAudio "
				errMsg += "enabled for MIME type: \'" + mime + "\'."
			}
		} else {
			errMsg += "Requires Navigator 3.x, 4.0-4.5, or 4.7-4.9."
		}
	} else {
		errMsg += "This page is certified only for versions of Internet Explorer "
		errMsg == "and Netscape Navigator."
	}
	alert(errMsg)
	OKToTest = false
	return type
}

function getOS() {
	var ua = navigator.userAgent
	if (ua.indexOf("Win") != -1) {
		return "Win"
	}
	if (ua.indexOf("Mac") != -1) {
		return "Mac"
	}
	return "Other"
}

function getBrand() {
	var name = navigator.appName
	if (name == "Netscape") {
		return "NN"
	}
	if (name.indexOf("Internet Explorer") != -1) {
		return "IE"
	}
	return "Other"
}

function getVersion(brand) {
	var ver = navigator.appVersion
	var ua = navigator.userAgent
	if (brand == "NN") {
		if (parseInt(ver, 10) < 5) {
			return parseFloat(ver, 10)
		} else {
			// get full version for NN6+
			return parseFloat(ua.substring(ua.lastIndexOf("/")+1))
		}
	}
	if (brand == "IE") {
		var IEOffset = ua.indexOf("MSIE ")
		return parseFloat(ua.substring(IEOffset + 5, ua.indexOf(";", IEOffset)))
	}
	return 0
}
